Configuration of project directory & analysis outputs:
Show full config
library(here)
## here() starts at /Users/selinjessa/Repos/rr
# Set up outputs
# ...determines the name of the cache folder
project_id <- "rr"
# ...determines name of the subfolder of `outputs` and `figures`
doc_id <- "01"
# ...specify where to save outputs
out <- here("output", doc_id); dir.create(out, recursive = TRUE)
figout <- here("figures", doc_id, "/")
cache <- paste0("~/tmp/", project_id, "/", doc_id, "/")
The root directory of this project is:
## /Users/selinjessa/Repos/rr
Outputs and figures will be saved at these paths, relative to project root:
## rr/output/01
## rr/figures/01//
This is an example of the first analysis in a project.
library(ggplot2)
library(tidyverse)
Here is a note to self. This markdown code is contained in a check, with visibility controlled by the echo chunk option.
Change echo to TRUE or FALSE to display/hide this chunk.
This part of the analysis generates a figure; we can use the chunk option echo_fig = TRUE to print its output path.
mtcars %>%
ggplot(aes(x = mpg, y = cyl)) +
geom_point() +
theme_bw()
[figure @ rr/figures/01//pressure…]
This part of the analysis saves the mtcars dataset from R as a TSV. By matching the chunk name to the output file name, we can then use the echo_out = TRUE chunk option to show the path to the file.
head(mtcars)
write.table(mtcars, file.path(out, "mtcars.tsv"))
[output @ rr/output/01/mtcars.tsv]
This document was last rendered on:
## 2020-05-23 20:38:29
The git repository and last commit:
## Local: master /Users/selinjessa/Repos/rr
## Remote: master @ origin (git@github.com:sjessa/rr.git)
## Head: [2db6f4d] 2020-05-24: Extract front/end matter into header and footer HTML
Session info:
## ─ Session info ───────────────────────────────────────────────────────────────
## setting value
## version R version 4.0.0 beta (2020-04-12 r78209)
## os macOS Catalina 10.15.3
## system x86_64, darwin17.0
## ui X11
## language (EN)
## collate en_CA.UTF-8
## ctype en_CA.UTF-8
## tz America/Montreal
## date 2020-05-23
##
## ─ Packages ───────────────────────────────────────────────────────────────────
## package * version date lib source
## assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
## backports 1.1.6 2020-04-05 [1] CRAN (R 4.0.0)
## broom 0.5.5 2020-02-29 [1] CRAN (R 4.0.0)
## callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.0)
## cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.0)
## cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
## colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0)
## crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
## DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.0)
## dbplyr 1.4.2 2019-06-17 [1] CRAN (R 4.0.0)
## desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0)
## devtools 2.3.0 2020-04-10 [1] CRAN (R 4.0.0)
## digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0)
## dplyr * 0.8.5 2020-03-07 [1] CRAN (R 4.0.0)
## ellipsis 0.3.0 2019-09-20 [1] CRAN (R 4.0.0)
## evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
## fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
## farver 2.0.3 2020-01-16 [1] CRAN (R 4.0.0)
## forcats * 0.5.0 2020-03-01 [1] CRAN (R 4.0.0)
## fs 1.4.1 2020-04-04 [1] CRAN (R 4.0.0)
## generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0)
## ggplot2 * 3.3.0 2020-03-05 [1] CRAN (R 4.0.0)
## git2r 0.27.1 2020-05-03 [1] CRAN (R 4.0.0)
## glue 1.4.0 2020-04-03 [1] CRAN (R 4.0.0)
## gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0)
## haven 2.2.0 2019-11-08 [1] CRAN (R 4.0.0)
## here * 0.1 2017-05-28 [1] CRAN (R 4.0.0)
## hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.0)
## htmltools 0.4.0 2019-10-04 [1] CRAN (R 4.0.0)
## httr 1.4.1 2019-08-05 [1] CRAN (R 4.0.0)
## jsonlite 1.6.1 2020-02-02 [1] CRAN (R 4.0.0)
## knitr 1.28 2020-02-06 [1] CRAN (R 4.0.0)
## labeling 0.3 2014-08-23 [1] CRAN (R 4.0.0)
## lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.0)
## lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0)
## lubridate 1.7.8 2020-04-06 [1] CRAN (R 4.0.0)
## magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0)
## memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0)
## modelr 0.1.6 2020-02-22 [1] CRAN (R 4.0.0)
## munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0)
## nlme 3.1-145 2020-03-04 [1] CRAN (R 4.0.0)
## pillar 1.4.3 2019-12-20 [1] CRAN (R 4.0.0)
## pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 4.0.0)
## pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
## pkgload 1.0.2 2018-10-29 [1] CRAN (R 4.0.0)
## prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0)
## processx 3.4.2 2020-02-09 [1] CRAN (R 4.0.0)
## ps 1.3.2 2020-02-13 [1] CRAN (R 4.0.0)
## purrr * 0.3.3 2019-10-18 [1] CRAN (R 4.0.0)
## R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
## Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
## readr * 1.3.1 2018-12-21 [1] CRAN (R 4.0.0)
## readxl 1.3.1 2019-03-13 [1] CRAN (R 4.0.0)
## remotes 2.1.1 2020-02-15 [1] CRAN (R 4.0.0)
## reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.0)
## rlang 0.4.5 2020-03-01 [1] CRAN (R 4.0.0)
## rmarkdown 2.1 2020-01-20 [1] CRAN (R 4.0.0)
## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0)
## rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.0)
## rvest 0.3.5 2019-11-08 [1] CRAN (R 4.0.0)
## scales 1.1.0 2019-11-18 [1] CRAN (R 4.0.0)
## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
## stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.0)
## stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.0.0)
## testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.0)
## tibble * 3.0.0 2020-03-30 [1] CRAN (R 4.0.0)
## tidyr * 1.0.2 2020-01-24 [1] CRAN (R 4.0.0)
## tidyselect 1.0.0 2020-01-27 [1] CRAN (R 4.0.0)
## tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.0)
## usethis 1.6.0 2020-04-09 [1] CRAN (R 4.0.0)
## vctrs 0.2.4 2020-03-10 [1] CRAN (R 4.0.0)
## withr 2.1.2 2018-03-15 [1] CRAN (R 4.0.0)
## xfun 0.13 2020-04-13 [1] CRAN (R 4.0.0)
## xml2 1.3.1 2020-04-09 [1] CRAN (R 4.0.0)
## yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0)
##
## [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library
A project of the Kleinman Lab at McGill University.